package com.tianji.remark.task;

import com.tianji.remark.service.ILikedRecordService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.List;
@Slf4j
@Component
@RequiredArgsConstructor
public class LikedTimesCheckedTask {

    private final ILikedRecordService likedRecordService;
    private final List<String> BIT_TYPE=List.of("QA","NOTE");
    private final Integer MAX_BIT_SIZE=30;
    @Scheduled(fixedDelay = 20000)
    public void checkedLikedTimes(){
        log.info("定时处理点赞总数");
        for (String type : BIT_TYPE) {
            likedRecordService.checkedTimesAndSendMsg(type,MAX_BIT_SIZE);
        }
    }
}
